package vim.meet.aspect;

import org.aspectj.lang.ProceedingJoinPoint;

public class AspectXmlStyle {
	
	private static final String NAME = AspectXmlStyle.class.getName();
	
	public Object profile(ProceedingJoinPoint call, String name, int age) throws Throwable {
		System.out.println("before");
		Object result = call.proceed();
		System.out.println("after");
		System.out.println("name:"+name);
		System.out.println("age:"+age);
		return result;
	}
	
	public void before()
	{
		System.out.println("in "+ NAME + " before!");
	}
	
	public void afterReturn(String retVal)
	{
		System.out.println("in "+ NAME + " afterReturn!");
		System.out.println("retVal:"+retVal);
	}
	
	public void afterThrowing(RuntimeException ex)
	{
		System.out.println("in "+ NAME + " afterThrowing!");
		System.out.println(ex.getMessage());
	}
	
	public void after()
	{
		//after finally
		System.out.println("in "+ NAME + " after!");
	}

}
